import requests
import re

url = 'https://www.acfun.cn/v/ac23857874'
head = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
}

resp = requests.get(url, headers=head)
# 获取视频标题
# 获取 m3u8 url地址
title = re.findall('<title >(.*?) - AcFun弹幕视频网 - 认真你就输啦', resp.text)[0]
m3u8_url = re.findall('backupUrl(.*?)\"]', resp.text)
# print(m3u8_url)
for i in m3u8_url:



    print(re.match(r'https(.*?)-', i))
    print(i)
    print("________________________________________________")
# print(resp.text)

print(title)